package com.bonc.rms.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bonc.rms.service.StudentService;
import com.alibaba.fastjson.JSON;
/**
 * 个人信息相关控制器
 */
@Controller
@RequestMapping(value = "/studentController")
public class StudentController {
	@Autowired
	StudentService studentService;
	
	 /**
     * 获取首页信息
     */
   @RequestMapping(value = { "/indexMessage"})
   @ResponseBody
   public String genderShow(@RequestParam(name = "UserId", required = true) Integer UserId){
       Map<String, Object> indexMessageMap = new HashMap<String,Object>();     
       indexMessageMap.put("inform",studentService.inform(UserId));
       indexMessageMap.put("task",studentService.task(UserId));
       indexMessageMap.put("weekToDo",studentService.weekToDo(UserId));
       return JSON.toJSONString(indexMessageMap);
   }
	
   /**
    * 获取需要考试科目信息
    */
  @RequestMapping(value = { "/needExamPage"})
  @ResponseBody
  public String needExamPage(@RequestParam(name = "UserId", required = true) Integer UserId){
      Map<String, Object> needExamMap = new HashMap<String,Object>();     
      needExamMap.put("needExam",studentService.needExam(UserId));
      return JSON.toJSONString(needExamMap);
  }
  
}
